<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:utils="http://java.sun.com/jsf/composite/utils"
        >

<f:view locale="#{localizer.locale}" contentType="text/html"/>

<h:head>
    <link href="resources/styles/main.css" rel="stylesheet" type="text/css"/>
    <title>#{m.title_search}</title>
</h:head>


<utils:menuComponent/>


<div class="product-container">

    <ul>
        <br/>

        <div class="found-info">'#{showProducts.searchParam}'&nbsp;#{m.found}:&nbsp;<span
                style="font-size:14px;font-weight:bold;">#{showProducts.foundCount}</span></div>

        <ui:repeat var="prod" value="#{showProducts.search}">

            <li class="product">

                <h:form>

                    <!-- PRG pattern,make bookmarkable URL -->
                    <h:inputHidden value="#{prod.id}"/>

                    <!-- PRG pattern,make bookmarkable URL -->
                    <h:commandLink action="#{bookmark.redir}" style="display:block;" includeViewParams="true">

                        <f:setPropertyActionListener target="#{showProducts.product}" value="#{prod}"/>
                        <span class="naming">#{prod.name}</span><br/>


                        <div class="image-holder">
                            <h:graphicImage value="#{prod.imgPath}" class="image-product"/>
                        </div>

                    </h:commandLink>


                </h:form>

                <div class="pricing">
                    &nbsp;#{prod.price} #{m.uah}.<br/>
                </div>


                <ui:remove>
                    <h:commandButton value="Buy" styleClass="button-buy button-container" action="#{showProducts.buy}">
                        <f:setPropertyActionListener target="#{showProducts.product}" value="#{prod}"/>
                    </h:commandButton>
                </ui:remove>

                <h:panelGroup class="presence-y" rendered="#{prod.present}">#{m.in_stock}</h:panelGroup>
                <h:panelGroup class="presence-n" rendered="#{!prod.present}">#{m.out_stock}</h:panelGroup>
            </li>

        </ui:repeat>
    </ul>

    <div class="footer-container footer-shift" style="margin-top:200px;">
        <utils:footer/>
    </div>

</div>


</html>